package org.jeecg.jxc.supplierManagement.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.jxc.supplierManagement.entity.TSupplier;
import org.jeecg.jxc.supplierManagement.mapper.TSupplierMapper;
import org.jeecg.jxc.supplierManagement.service.TSupplierService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @company:yaorange
 * @author:Mr.Gao
 * @version:1.0
 * @create:2022-06-21 16:48:06
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class TSupplierServiceImpl implements TSupplierService {

    @Resource
    private TSupplierMapper tSupplierMapper;

    @Override
    public List<TSupplier> list() {
        return tSupplierMapper.selectList();
    }


    @Override
    public int addUser(TSupplier tSupplier) {
        return tSupplierMapper.insertTSupplier(tSupplier);
    }

    @Override
    public int updateUser(TSupplier tSupplier) {
        return tSupplierMapper.updateTSupplier(tSupplier);
    }

    @Override
    public IPage<TSupplier> page(Page<TSupplier> tSupplierPage, String supplierName) {
        return tSupplierMapper.selectPage(tSupplierPage,supplierName);
    }
    @Override
    public IPage<TSupplier> pageList(Page<TSupplier> tSupplierPage) {
        return tSupplierMapper.selectPageList(tSupplierPage);
    }
    @Override
    public int delets(List<Integer> ids) {
        return tSupplierMapper.delets(ids);
    }

    @Override
    public int delet(Integer id) {
        return tSupplierMapper.delete(id);
    }


}
